/*
案例 2：输出英文星期几
用一个数组，保存星期一到星期天的 7 个英语单词，从键盘输入 1-7，显示对
应的单词
{"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"}
*/
import java.util.Scanner;
public class test520_1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String[] weeks = {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
        System.out.print("请输入1-7个整数：");
        int shu = scan.nextInt();
        switch (shu) {
            case 1:
                System.out.println(weeks[0]);
            break;
            case 2:
                System.out.println(weeks[1]);
            break;
            case 3:
                System.out.println(weeks[2]);
            break;
            case 4:
                System.out.println(weeks[3]);
            break;
            case 5:
                System.out.println(weeks[4]);
            break;
            case 6:
                System.out.println(weeks[5]);
            break;
            case 7:
                System.out.println(weeks[6]);
            break;
            default:
                System.out.println("输入有误");
        }
        //方式二
        if(shu < 1 || shu > 7){
            System.out.println("输入有误");
        }else{
            System.out.println(weeks[shu - 1]);
        }
        scan.close();
    }
}
